package com.rizzo.analytics.services.web.delegator;

import com.rizzo.analytics.domain.account.Account;
import com.rizzo.analytics.domain.trigger.Trigger;
import com.rizzo.analytics.services.web.controller.v1.error.AccountNotFoundException;
import com.rizzo.analytics.services.web.controller.v1.error.DuplicateEntityException;
import com.rizzo.analytics.services.web.controller.v1.error.MalformedRequestException;
import com.rizzo.analytics.services.web.controller.v1.error.TriggerNotFoundException;

import java.util.List;

public interface AccountDelegator {

	List<Account> getAccounts(String user);

	Account saveAccount(String user, Account account) throws MalformedRequestException, DuplicateEntityException;

	Account updateAccount(String user, Account account) throws AccountNotFoundException, MalformedRequestException;

	void deleteAccount(String user, Long accountId) throws AccountNotFoundException;

	Account getAccount(String user, Long accountId) throws AccountNotFoundException;

	List<Trigger> getTriggers(String user, Long accountId) throws AccountNotFoundException;

	Trigger getTrigger(String user, Long accountId, Long triggerId) throws AccountNotFoundException, TriggerNotFoundException;

	Trigger saveTrigger(String user, Long accountId, Trigger trigger) throws AccountNotFoundException, TriggerNotFoundException;

	Trigger updateTrigger(String user, Long accountId, Trigger trigger) throws AccountNotFoundException, TriggerNotFoundException, MalformedRequestException;

	void deleteTrigger(String user, Long accountId, Long triggerId) throws AccountNotFoundException, TriggerNotFoundException;

}
